import {Component} from '@angular/core';
import {IonicPage, NavController, NavParams} from 'ionic-angular';
import {WorkerProvider} from "@providers/interface/worker";
import {env} from "@env/environment";
import {DomSanitizer} from "@angular/platform-browser";

/**
 * Generated class for the WorkerCompletionRecordItemPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-worker-completion-record-item',
  templateUrl: 'worker-completion-record-item.html',
})
export class WorkerCompletionRecordItemPage {

  data: any;
  dataItem : any={};
  dev :boolean;

  constructor(public navCtrl: NavController,
              public navParams: NavParams,
              private worker: WorkerProvider,
              public sanitizer: DomSanitizer) {
    this.dev = env.mode == "prod";
    this.data =  this.navParams.data;
  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad WorkerCompletionRecordItemPage');
    this.worker.querywgxxSJ({"GDDH": this.data.ID}).then((res) => {
      this.dataItem = res.data[0];
    }).catch(() => {
    })
  }

  push(page: string, data?: any) {
    this.navCtrl.push(page, data);
  }

}
